package com.link.play.fit.ai.bean

import java.io.Serializable


data class ExerciseBean(
    val type: Int = -1,//0 run ; 1 weight lift ;  3 describe
    var intensityPercent: Int = 50,//运动强度
    var time: Int = 30,//运动时间
    var describe: String = "",//运动描述
    var cal: Int = 0,
    var modify: Int = 0,//0 新增;1 修改; -1 删除
) : Serializable {
    companion object {
        fun ExerciseBean.getMET(): Float {
            var met = 0f
            if (type == 0) {
                when (intensityPercent) {
                    in 0..33 -> met = 14f
                    in 34..66 -> met = 8f
                    in 67..100 -> met = 3.9f
                }
            }
            if (type == 1) {
                when (intensityPercent) {
                    in 0..33 -> met = 6f
                    in 34..66 -> met = 4f
                    in 67..100 -> met = 2.5f
                }
            }
            return met
        }

    }
}
